package com.sgg.gulimall_coupon.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fileworld
 * @version 1.0
 * @create 2021/9/24 0024
 * @project base_spring_cloud
 * @description
 */
@RefreshScope
@RestController
@RequestMapping("/demo")
public class DemoController {

    @GetMapping
    public String Demo(){
        return "youhuijuan";
    }

    @Value("${coupon.name}")
    private String name;

    @Value("${coupon.age}")
    private String age;

    @GetMapping("/configDemo")
    public String ConfigDemo(){
        return name+age;
    }
}
